package com.landeb.shop.huo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.landeb.shop.R;
import com.landeb.shop.huo.bean.BeanActRewardLog;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by blade on 2017/4/13.
 */

public class ActRewardLogRVAdapter extends BaseQuickAdapter<BeanActRewardLog.DataBean.ListBean, BaseViewHolder> {

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm");


    public ActRewardLogRVAdapter(int layoutResId, List<BeanActRewardLog.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanActRewardLog.DataBean.ListBean item) {

        String time = simpleDateFormat.format(new Date(Long.parseLong(item.getCtime())));

        helper.setText(R.id.tv_name_item_reward_log_act_rv, item.getDetail())
                .setText(R.id.tv_money_item_reward_log_act_rv, item.getMoney())
                .setText(R.id.tv_time_item_reward_log_act_rv, time);
    }
}
